<#include "common.ftl">
ALTER TABLE `${oldTableName}`<#t>
<#-- 修改表名 -->
<#if name??&&name?length gt 0>
    RENAME TO `${sanitize(name)}`<#t>
</#if>
<#if engine?has_content>
    ,<#t>
</#if>
<#-- 修改表引擎 -->
<#if engine??&&engine?length gt 0>
    ENGINE = ${engine?upper_case}<#t>
</#if>
<#if charset?has_content>
    ,<#t>
</#if>
<#-- 修改表字符集编码 -->
<#if charset??&&charset?length gt 0>
    DEFAULT CHARACTER SET = ${charset?upper_case}<#t>
</#if>
<#if collate?has_content>
    ,<#t>
</#if>
<#-- 是否区分大小写 -->
<#if collate??&&collate == "Y">
    COLLATE = utf8mb4_0900_as_cs<#t>
<#elseif collate??&&collate == "N">
    COLLATE = utf8mb4_0900_ai_ci<#t>
</#if>
<#if comment?has_content>
    ,<#t>
</#if>
<#-- 表备注 -->
<#if comment??&&comment?length gt 0>
    COMMENT = '${sanitize(comment)}';<#t>
</#if>
